﻿-var responsibleids = ViewData["responsibleids"] as int[]
-var responsibles = ViewData["responsibles"] as IList<IClient>
.field
  %label.inline.required.printbold{for="responsibles"}Поверенные:
  -if (!readOnly) 
    .inline
      %a.button{href="#",onclick="return addUser('responsibles')"} <img src="img/addsmall.gif" /> Еще один поверенный 
  %ul#responsibles.items
    -if (responsibles != null && responsibles.Count > 0)
      -foreach(var r in responsibles)
        %li.client{id=r.Cid}
          -if (!ViewData.ContainsKey("print"))
            %a.noul{href="#", onclick=string.Format("return showUser({0})",r.Cid)}=r.Name
            -if(!readOnly)
              %span.hoverspan
                %a{href="#", onclick=String.Format("return removeUser(this, '{0}')",r.Cid)}
                  %img{src="img/trash.gif"}
          -else
            =r.Name
  -if (!ViewData.ContainsKey("print"))  
    #addresponsibles
      %ul#addedresponsibles.items
        -if (responsibles == null || responsibles.Count == 0)
          %li.empty.details.hidden Нет поверенных 
    %select{multiple="true", class="hidden nolink required", name="responsibleids", id="responsibleids"}
      -foreach(IClient c in responsibles)
        %option{selected="true", value=c.Cid}c.Name 